<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>赚不停</title>
</head>
<body>
	<div class="loading"><img src="images/ajax-loader.gif"/></div>
	<div data-role="page" class="month" id="month">
		<!--jqmb需要把所以东西放在page div内-->
		 <link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css"/>
   		 <link rel="stylesheet" href="css/style.css"/>
   		 
   		<!--jqmb需要把所以东西放在page div内--> 
		<header data-role="header" data-position="fixed">
			<a href="#" data-rel="back" class="ui-btn ui-icon-carat-l ui-btn-icon-left ui-nodisc-icon" data-transition="slide" data-direction="reverse">返回</a> 
			<h3>模拟邀请好友</h3>
		</header>
		<div class="ui-content" data-role="content">
			<section class="month-top">
				<h3>邀请好友</h3>
				<input type="text" class="form-control" id="userName" placeholder="请输入要邀请好友的名称">
			</section>
			<article class="month-text">
				<h3>平台保障</h3>
				<p>这是平台保障，虽然我也不知道这是什么，反正这里是文字就是了，嗯</p>
			</article>
			<article class="month-text">
				<h3>介绍</h3>
				<p>这是邀请好友，这里只是模拟邀请，邀请后就会成功，可以在下级会员中查看</p>
			</article>
			<article class="month-text">
				<h3>投资记录</h3>
				<h4>您还未投资该项目</h4>
			</article>
		</div>
		<footer data-role="footer" data-position="fixed">
			<a href="javascript:void(0)" onclick="invite()" data-transition="slide">邀请</a>
		</footer>
		<input th:value="@{/}" id="path" type="hidden">
		<script src="js/jquery.min.js"></script>
   		<script src="js/jquery.mobile-1.4.5.min.js"></script>
   		<script type="text/javascript">
   			$(window).load(function(){
					$(".loading").fadeOut()
				})
			function  invite() {
				var userName=$("#userName").val();
				if(userName==""){
				    alert("请输入邀请好友的id");
				    return ;
				}
                var path=$("#path").val();
				$.ajax({
					url:path+"inviteUser",
					data:{"userName":userName},
                    success:function (result) {
					    if(result.success){
                            alert("邀请成功");
						}else{
                            alert(result.errorMessage);
						}

                    }
				});
            }
   		</script>
	</div>
	
</body>
</html>